package com.net.tkc.pro;

import com.net.tkc.pro.tool.OCRUtil;
import com.net.tkc.pro.tool.OSSUtil;
import com.net.tkc.pro.tool.TTSUtil;
import com.net.tkc.pro.tool.ZIPUtil;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Map;

public class test {//测试方法
    public static void main(String[] args){
       /** OSSUtil ossUtil = new OSSUtil();
        for(int i=1;i<=9;i++){
            if(ossUtil.updateFile("c://tx//"+String.valueOf(i)+".jpg",String.valueOf(i)+".jpg")){
                System.out.println("c://tx//"+String.valueOf(i)+".jpg"+"上传成功！");
            }else{
                System.out.println("c://tx//"+String.valueOf(i)+".jpg"+"上传失败！");
            }

        }
        String Result = ossUtil.downLoadUrl("1.jpg");
        System.out.println("下载接口地址"+Result);**/
        OCRUtil ocrUtil = new OCRUtil();
        //System.out.println(ocrUtil.animal("c://tx//cat.jpg"));
        //Type 3：车牌，2：身份证，1:通用识别
      /**  Map<String,String> map = ocrUtil.BasicOCR("c://tx//cp.jpg",3);
        System.out.println(map.get("车牌"));**/
     /**   Map<String,String> map = ocrUtil.BasicOCR("c://tx//sfz.jpg",2);
        String [] par= new String[]{"姓名","民族","住址","公民身份号码","出生","性别"};
        for(int i=0;i<par.length;i++){
            System.out.println(map.get(par[i]));
        }**/
       /** TTSUtil ttsUtil =  new TTSUtil();
        String temp=ttsUtil.TextToAudio("你好，欢迎您就读浙江纺织服装学院计算机应用专业");
        System.out.println(temp);**/
      /* File [] files = new File[9];
        for (int i=1;i<=9;i++){//待压缩的文件
            files[i-1]=new File("c://tx//"+String.valueOf(i)+".jpg");
        }
        File zipFile= new File("c://tx//test.zip");//压缩包
        ZIPUtil zipUtil = new ZIPUtil();
        if(zipUtil.ToZIPFiles(files,zipFile)){
            System.out.println("压缩成功");
        }else {
            System.out.println("压缩失败");
        }*/
        try{
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
           /* int screenWidth = (int) screenSize.getWidth();
            int screenHeight = (int) screenSize.getHeight();*/
            int screenWidth = 600;
            int screenHeight = 800;
            Robot robot=new Robot();
            BufferedImage bi=robot.createScreenCapture(new Rectangle(screenWidth,screenHeight));
            ImageIO.write(bi, "jpg", new File("C:/1.jpg"));
        }catch (Exception e){
            e.printStackTrace();
        }


    }
}
